package com.example.web_chat.model;

import com.example.web_chat.toolsUtil.Constant;

public class Result {
    /*
    200 表示成功
    -1 表示失败
     */
    public Integer code;
    public String errorMage;
    public Object data;

    public static Result success(Object data) {
        Result result = new Result();
        result.code = Constant.SUCCESS_CODE;
        result.data = data;
        return result;
    }
    public static Result success() {
        Result result = new Result();
        result.code = Constant.SUCCESS_CODE;
        return result;
    }

    public static Result fail(String errorInfo) {
        Result result = new Result();
        result.code = Constant.FAIL_CODE;
       result.errorMage = errorInfo;
       return result;
    }

}
